//
// Created by HP on 2022/1/22.
//

#ifndef VULKAN_TUTORIAL_SIMPLE_RENDER_SYSTEM_H
#define VULKAN_TUTORIAL_SIMPLE_RENDER_SYSTEM_H


#include "lve_pipeline.h"
#include "lve_device.h"
#include "lve_game_object.h"
#include "lve_camera.h"

// std
#include <memory>

namespace lve {
    class SimpleRenderSystem {
    public:

        SimpleRenderSystem(LveDevice& device, VkRenderPass renderPass);
        ~SimpleRenderSystem();

        SimpleRenderSystem(const SimpleRenderSystem&) = delete;
        SimpleRenderSystem& operator=(const SimpleRenderSystem&) = delete;

        void renderGameObjects(VkCommandBuffer commandBuffer, std::vector<LveGameObject>& gameObjects, const LveCamera& camera);

    private:
        void createPipelineLayout();
        void createPipeline(VkRenderPass renderPass);

        LveDevice& lveDevice;
        std::unique_ptr<LvePipeline> lvePipeline;
        VkPipelineLayout  pipelineLayout = nullptr;
    };
}


#endif //VULKAN_TUTORIAL_SIMPLE_RENDER_SYSTEM_H
